<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>中俊为 | we harmonyos</title>
    <meta name="generator" content="VuePress 1.9.7">
    <script>
          var _hmt = _hmt || [];
          (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?39485dba914ae63b24732b6a90688f0b";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
          })();
      </script>
    <link rel="manifest" href="/manifest.webmanifest" crossorigin="use-credentials">
    <meta name="description" content="weharmonyos 鸿蒙论坛 鸿蒙注释 开源鸿蒙 鸿蒙源码 openharmony源码 HarmonyOS源码 HarmonyOS HarmonyOS生态 openharmony开发者文档 鸿蒙生态 鸿蒙系统 华为操作系统 鸿蒙研究站 开放原子开源基金会 百万汉字注解鸿蒙 百篇博客分析鸿蒙">
    <meta property="og:url" content="/blog/102.html">
    <meta property="og:site_name" content="中俊为 | we harmonyos">
    <meta property="og:description" content="中文注解鸿蒙内核 | kernel_liteos_a_note 是在 OpenHarmony 的 kernelliteosa 基础上给内核源码加上中文注解的版本，同步官方代码迭代推进。 为何要精读内核源码？码农的学职生涯，都应精读一遍内核源码。以浇筑好计算机知识大厦的地基，地基纵深的坚固程度，很大程度能决定未来大厦能盖多高。那为何一定要精读细品呢？; 因">
    <meta property="og:type" content="article">
    <meta property="og:locale" content="en-US">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:image:alt" content="中俊为 | we harmonyos">
    <meta name="theme-color" content="#46bd87">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
    
    <link rel="preload" href="/assets/css/0.styles.087eb7d3.css" as="style"><link rel="preload" href="/assets/js/app.9a8b95d8.js" as="script"><link rel="preload" href="/assets/js/vendors~layout-Layout.c1e797d4.js" as="script"><link rel="preload" href="/assets/js/vendors~layout-Blog~layout-Layout~layout-NotFound.f75cf258.js" as="script"><link rel="preload" href="/assets/js/page--7180d470.73a3a20e.js" as="script"><link rel="prefetch" href="/assets/js/160.a8046d43.js"><link rel="prefetch" href="/assets/js/161.29f8564f.js"><link rel="prefetch" href="/assets/js/162.249ee491.js"><link rel="prefetch" href="/assets/js/163.c57d1577.js"><link rel="prefetch" href="/assets/js/164.7a788aaa.js"><link rel="prefetch" href="/assets/js/165.c333afb2.js"><link rel="prefetch" href="/assets/js/166.9bcb7cd6.js"><link rel="prefetch" href="/assets/js/layout-Blog.4a9781d1.js"><link rel="prefetch" href="/assets/js/layout-Layout.7e277e0b.js"><link rel="prefetch" href="/assets/js/layout-NotFound.9326b14e.js"><link rel="prefetch" href="/assets/js/layout-Slide.8dd861e4.js"><link rel="prefetch" href="/assets/js/page--00854288.e2bc8e8a.js"><link rel="prefetch" href="/assets/js/page--00f8db0a.b2a35fe6.js"><link rel="prefetch" href="/assets/js/page--03ad6df0.d48f4c19.js"><link rel="prefetch" href="/assets/js/page--04b12ba8.e8add78d.js"><link rel="prefetch" href="/assets/js/page--070d2528.d24cd503.js"><link rel="prefetch" href="/assets/js/page--086560f0.a6be2844.js"><link rel="prefetch" href="/assets/js/page--090ad32d.fc7da3c3.js"><link rel="prefetch" href="/assets/js/page--0c054030.2886024e.js"><link rel="prefetch" href="/assets/js/page--0d9507c8.a27dee03.js"><link rel="prefetch" href="/assets/js/page--10bd3330.b5165172.js"><link rel="prefetch" href="/assets/js/page--1233b0b2.b5caca9c.js"><link rel="prefetch" href="/assets/js/page--13650e88.61330a2b.js"><link rel="prefetch" href="/assets/js/page--14c850b1.d9a40c31.js"><link rel="prefetch" href="/assets/js/page--15752630.25f9c756.js"><link rel="prefetch" href="/assets/js/page--19150570.58df8995.js"><link rel="prefetch" href="/assets/js/page--19ecf128.130d012b.js"><link rel="prefetch" href="/assets/js/page--1c48eaa8.9a689e30.js"><link rel="prefetch" href="/assets/js/page--1d4dfe96.bd551921.js"><link rel="prefetch" href="/assets/js/page--1dccf870.03d7d9cc.js"><link rel="prefetch" href="/assets/js/page--2074d3c8.06bf5706.js"><link rel="prefetch" href="/assets/js/page--22213c96.e703257a.js"><link rel="prefetch" href="/assets/js/page--2284eb70.514124de.js"><link rel="prefetch" href="/assets/js/page--22d0cd48.11ea1522.js"><link rel="prefetch" href="/assets/js/page--252cc6c8.f9acae83.js"><link rel="prefetch" href="/assets/js/page--2624cab0.4535fea2.js"><link rel="prefetch" href="/assets/js/page--269ff8f9.012e8ae6.js"><link rel="prefetch" href="/assets/js/page--26fcb668.35b2da5d.js"><link rel="prefetch" href="/assets/js/page--2958afe8.216913bc.js"><link rel="prefetch" href="/assets/js/page--2adcbdb0.6dcb4c27.js"><link rel="prefetch" href="/assets/js/page--2bb4a968.aac31797.js"><link rel="prefetch" href="/assets/js/page--2d849908.7bb4e817.js"><link rel="prefetch" href="/assets/js/page--2e10a2e8.42bef48d.js"><link rel="prefetch" href="/assets/js/page--2f94b0b0.0c993df5.js"><link rel="prefetch" href="/assets/js/page--2fe09288.77769dcb.js"><link rel="prefetch" href="/assets/js/page--323c8c08.254a5f78.js"><link rel="prefetch" href="/assets/js/page--33348ff0.a5f99eb0.js"><link rel="prefetch" href="/assets/js/page--340c7ba8.2c9570cb.js"><link rel="prefetch" href="/assets/js/page--34988588.8c8d0363.js"><link rel="prefetch" href="/assets/js/page--36687528.67d84e0d.js"><link rel="prefetch" href="/assets/js/page--37d6dfd6.88e9cd42.js"><link rel="prefetch" href="/assets/js/page--37ec82f0.5419c82d.js"><link rel="prefetch" href="/assets/js/page--37f7cf15.65f72e55.js"><link rel="prefetch" href="/assets/js/page--38c46ea8.5d5150f9.js"><link rel="prefetch" href="/assets/js/page--3a945e48.bf9758fb.js"><link rel="prefetch" href="/assets/js/page--3ab2204c.e08d6316.js"><link rel="prefetch" href="/assets/js/page--3b206828.d83e3926.js"><link rel="prefetch" href="/assets/js/page--3ca475f0.49e5acce.js"><link rel="prefetch" href="/assets/js/page--3cf057c8.8364331d.js"><link rel="prefetch" href="/assets/js/page--3f4c5148.587a8360.js"><link rel="prefetch" href="/assets/js/page--40445530.486bb516.js"><link rel="prefetch" href="/assets/js/page--411c40e8.2eedba0e.js"><link rel="prefetch" href="/assets/js/page--41a84ac8.f4a360a3.js"><link rel="prefetch" href="/assets/js/page--4220f8b5.19b4371f.js"><link rel="prefetch" href="/assets/js/page--43783a68.4faf0866.js"><link rel="prefetch" href="/assets/js/page--44fc4830.a160662c.js"><link rel="prefetch" href="/assets/js/page--45d433e8.560fef87.js"><link rel="prefetch" href="/assets/js/page--47a42388.052314b4.js"><link rel="prefetch" href="/assets/js/page--47d07816.66731286.js"><link rel="prefetch" href="/assets/js/page--48302d68.8d6493cf.js"><link rel="prefetch" href="/assets/js/page--49b43b30.e3684736.js"><link rel="prefetch" href="/assets/js/page--4a001d08.47f7ec45.js"><link rel="prefetch" href="/assets/js/page--4c5c1688.b7ec1f32.js"><link rel="prefetch" href="/assets/js/page--4d541a70.ee807705.js"><link rel="prefetch" href="/assets/js/page--4e2c0628.4f7105a4.js"><link rel="prefetch" href="/assets/js/page--4eb81008.725d26fe.js"><link rel="prefetch" href="/assets/js/page--5087ffa8.dac2aae0.js"><link rel="prefetch" href="/assets/js/page--520c0d70.2beedefb.js"><link rel="prefetch" href="/assets/js/page--52e3f928.2645087c.js"><link rel="prefetch" href="/assets/js/page--53cd0b44.96d4a285.js"><link rel="prefetch" href="/assets/js/page--54eb2c5e.27eb702b.js"><link rel="prefetch" href="/assets/js/page--553ff2a8.fba8ee4f.js"><link rel="prefetch" href="/assets/js/page--5686ab01.547b633c.js"><link rel="prefetch" href="/assets/js/page--56c40070.4e35708a.js"><link rel="prefetch" href="/assets/js/page--570fe248.2b301b36.js"><link rel="prefetch" href="/assets/js/page--596bdbc8.c74cd724.js"><link rel="prefetch" href="/assets/js/page--5a63dfb0.bbd49a9b.js"><link rel="prefetch" href="/assets/js/page--5bc7d548.eda26865.js"><link rel="prefetch" href="/assets/js/page--5f1bd2b0.e02cf88d.js"><link rel="prefetch" href="/assets/js/page--5ff3be68.b2b0e76e.js"><link rel="prefetch" href="/assets/js/page--624fb7e8.666fdc84.js"><link rel="prefetch" href="/assets/js/page--63d3c5b0.b587d38f.js"><link rel="prefetch" href="/assets/js/page--68d79a88.86f62e4d.js"><link rel="prefetch" href="/assets/js/page--6c2b97f0.ed46abea.js"><link rel="prefetch" href="/assets/js/page--6cc6a596.b3827451.js"><link rel="prefetch" href="/assets/js/page--6ea7a148.61a9bc10.js"><link rel="prefetch" href="/assets/js/page--70e38af0.eb8ffc53.js"><link rel="prefetch" href="/assets/js/page--752f83e8.d5c31640.js"><link rel="prefetch" href="/assets/js/page--778b7d68.5e8e5ea9.js"><link rel="prefetch" href="/assets/js/page--7bb76688.53e305e3.js"><link rel="prefetch" href="/assets/js/page--7c59a86a.ecf88c30.js"><link rel="prefetch" href="/assets/js/page--7df35030.cfa388f4.js"><link rel="prefetch" href="/assets/js/page--7e136008.230e9a15.js"><link rel="prefetch" href="/assets/js/page--89935db0.f79f9e25.js"><link rel="prefetch" href="/assets/js/page--96a322f0.412d537f.js"><link rel="prefetch" href="/assets/js/page--9b5b15f0.a5231547.js"><link rel="prefetch" href="/assets/js/page--a3b2e830.f4ba68fa.js"><link rel="prefetch" href="/assets/js/page--a86adb30.ec08486b.js"><link rel="prefetch" href="/assets/js/page--ad22ce30.4872eca4.js"><link rel="prefetch" href="/assets/js/page--b0c2ad70.8637057e.js"><link rel="prefetch" href="/assets/js/page--b57aa070.43215f9e.js"><link rel="prefetch" href="/assets/js/page--ba329370.b5f22d13.js"><link rel="prefetch" href="/assets/js/page--bdd272b0.aff1d1a9.js"><link rel="prefetch" href="/assets/js/page--c28a65b0.978514c4.js"><link rel="prefetch" href="/assets/js/page--c606edca.49d3396e.js"><link rel="prefetch" href="/assets/js/page--c74258b0.f85195bc.js"><link rel="prefetch" href="/assets/js/page--cae237f0.8a976cc1.js"><link rel="prefetch" href="/assets/js/page--cf9a2af0.7ad20ea2.js"><link rel="prefetch" href="/assets/js/page--d4521df0.a0a74934.js"><link rel="prefetch" href="/assets/js/page--d7f1fd30.160f138a.js"><link rel="prefetch" href="/assets/js/page--dca9f030.9127ab28.js"><link rel="prefetch" href="/assets/js/page--e161e330.34876a6f.js"><link rel="prefetch" href="/assets/js/page--e4f35ef4.690d3ccb.js"><link rel="prefetch" href="/assets/js/page--e501c270.8dc088ee.js"><link rel="prefetch" href="/assets/js/page--e9b9b570.b94764ed.js"><link rel="prefetch" href="/assets/js/page--ea4e0a70.94492571.js"><link rel="prefetch" href="/assets/js/page--ee71a870.b9944792.js"><link rel="prefetch" href="/assets/js/page--f21187b0.d00a5788.js"><link rel="prefetch" href="/assets/js/page--f6c97ab0.ecb91d64.js"><link rel="prefetch" href="/assets/js/page--fb816db0.c1f07c37.js"><link rel="prefetch" href="/assets/js/page--fcf2f51e.71000d71.js"><link rel="prefetch" href="/assets/js/page--ff214cf0.aaa8b0fc.js"><link rel="prefetch" href="/assets/js/page-GN.2f20b55f.js"><link rel="prefetch" href="/assets/js/page-GNFrequentlyAskedQuestions.24e61c26.js"><link rel="prefetch" href="/assets/js/page-GNLanguageandOperation.35e22ff2.js"><link rel="prefetch" href="/assets/js/page-GNQuickStartguide.7cd8e521.js"><link rel="prefetch" href="/assets/js/page-GNReference.1d5d0c6c.js"><link rel="prefetch" href="/assets/js/page-GNSimpleBuildExample.2eb0b7eb.js"><link rel="prefetch" href="/assets/js/page-GNStyleGuide.8a407135.js"><link rel="prefetch" href="/assets/js/page-GNU汇编教程.d208e4d7.js"><link rel="prefetch" href="/assets/js/page-GNvimsyntaxplugin.58d1459e.js"><link rel="prefetch" href="/assets/js/page-GN快速入门.b708bb6a.js"><link rel="prefetch" href="/assets/js/page-Home.97282d71.js"><link rel="prefetch" href="/assets/js/page-HowGNhandlescross-compiling.6ca64957.js"><link rel="prefetch" href="/assets/js/page-Introduction.292088e0.js"><link rel="prefetch" href="/assets/js/page-ninja快速入门.92729e64.js"><link rel="prefetch" href="/assets/js/page-《孙子兵法》全文.402792c5.js"><link rel="prefetch" href="/assets/js/page-《论语》全文.85da0da0.js"><link rel="prefetch" href="/assets/js/page-《诗经》全文.99ebeb52.js"><link rel="prefetch" href="/assets/js/page-《道德经》全文.43627e4e.js"><link rel="prefetch" href="/assets/js/page-两个文档.eb8dd1b7.js"><link rel="prefetch" href="/assets/js/page-主流站点覆盖定期同步更新.1ad02178.js"><link rel="prefetch" href="/assets/js/page-手机版电脑版.b5e8dfea.js"><link rel="prefetch" href="/assets/js/page-捐助方式.6ca91d44.js"><link rel="prefetch" href="/assets/js/page-来源LiteOS和LiteOS-A内核图解.8fa16705.js"><link rel="prefetch" href="/assets/js/page-电脑版手机版.67a0b4a4.js"><link rel="prefetch" href="/assets/js/page-编程语言相关书籍.d9adf7cb.js"><link rel="prefetch" href="/assets/js/page-鸿蒙内核源码分析.bbb451c7.js"><link rel="prefetch" href="/assets/js/vendors~flowchart.46b2de48.js"><link rel="prefetch" href="/assets/js/vendors~mermaid.627fb4be.js"><link rel="prefetch" href="/assets/js/vendors~photo-swipe.cbde97f9.js"><link rel="prefetch" href="/assets/js/vendors~reveal.77b21b7e.js">
    <link rel="stylesheet" href="/assets/css/0.styles.087eb7d3.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container has-navbar has-sidebar has-anchor"><header class="navbar"><!----> <div class="content__navbar-start"></div> <button title="Sidebar Button" class="sidebar-button"><span class="icon"></span></button> <a href="/" class="home-link router-link-active"><!----> <!----> <span class="site-name can-hide">中俊为 | we harmonyos</span></a> <!----> <div class="content__navbar-center"></div> <div class="links"><button tabindex="-1" aria-hidden="true" class="color-button"><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" class="skin-icon"><path d="M224 800c0 9.6 3.2 44.8 6.4 54.4 6.4 48-48 76.8-48 76.8s80 41.6 147.2 0 134.4-134.4
        38.4-195.2c-22.4-12.8-41.6-19.2-57.6-19.2C259.2 716.8 227.2 761.6 224 800zM560 675.2l-32
        51.2c-51.2 51.2-83.2 32-83.2 32 25.6 67.2 0 112-12.8 128 25.6 6.4 51.2 9.6 80 9.6 54.4 0
        102.4-9.6 150.4-32l0 0c3.2 0 3.2-3.2 3.2-3.2 22.4-16 12.8-35.2
        6.4-44.8-9.6-12.8-12.8-25.6-12.8-41.6 0-54.4 60.8-99.2 137.6-99.2 6.4 0 12.8 0 22.4
        0 12.8 0 38.4 9.6 48-25.6 0-3.2 0-3.2 3.2-6.4 0-3.2 3.2-6.4 3.2-6.4 6.4-16 6.4-16 6.4-19.2
        9.6-35.2 16-73.6 16-115.2 0-105.6-41.6-198.4-108.8-268.8C704 396.8 560 675.2 560 675.2zM224
        419.2c0-28.8 22.4-51.2 51.2-51.2 28.8 0 51.2 22.4 51.2 51.2 0 28.8-22.4 51.2-51.2 51.2C246.4
        470.4 224 448 224 419.2zM320 284.8c0-22.4 19.2-41.6 41.6-41.6 22.4 0 41.6 19.2 41.6 41.6 0
        22.4-19.2 41.6-41.6 41.6C339.2 326.4 320 307.2 320 284.8zM457.6 208c0-12.8 12.8-25.6 25.6-25.6
        12.8 0 25.6 12.8 25.6 25.6 0 12.8-12.8 25.6-25.6 25.6C470.4 233.6 457.6 220.8 457.6 208zM128
        505.6C128 592 153.6 672 201.6 736c28.8-60.8 112-60.8 124.8-60.8-16-51.2 16-99.2
        16-99.2l316.8-422.4c-48-19.2-99.2-32-150.4-32C297.6 118.4 128 291.2 128 505.6zM764.8
        86.4c-22.4 19.2-390.4 518.4-390.4 518.4-22.4 28.8-12.8 76.8 22.4 99.2l9.6 6.4c35.2 22.4
        80 12.8 99.2-25.6 0 0 6.4-12.8 9.6-19.2 54.4-105.6 275.2-524.8 288-553.6
        6.4-19.2-3.2-32-19.2-32C777.6 76.8 771.2 80 764.8 86.4z"></path></svg> <div class="color-picker-menu" style="display:none;"><div class="theme-options"><ul class="themecolor-select"><label for="themecolor-select">Theme Color:</label> <li><span class="default-theme"></span></li> </ul> <div class="darkmode-toggle"><label for="darkmode-toggle" class="desc">Theme Mode:</label> <div class="darkmode-switch"><div class="item day"><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" class="icon light-icon"><path d="M512 256a42.667 42.667 0 0 0 42.667-42.667V128a42.667 42.667 0 0 0-85.334 0v85.333A42.667 42.667 0 0 0 512 256zm384 213.333h-85.333a42.667 42.667 0 0 0 0 85.334H896a42.667 42.667 0 0 0 0-85.334zM256 512a42.667 42.667 0 0 0-42.667-42.667H128a42.667 42.667 0 0 0 0 85.334h85.333A42.667 42.667 0 0 0 256 512zm9.387-298.667a42.667 42.667 0 0 0-59.307 62.72l61.44 59.307a42.667 42.667 0 0 0 31.147 11.947 42.667 42.667 0 0 0 30.72-13.227 42.667 42.667 0 0 0 0-60.16zm459.946 133.974a42.667 42.667 0 0 0 29.44-11.947l61.44-59.307a42.667 42.667 0 0 0-57.6-62.72l-61.44 60.587a42.667 42.667 0 0 0 0 60.16 42.667 42.667 0 0 0 28.16 13.227zM512 768a42.667 42.667 0 0 0-42.667 42.667V896a42.667 42.667 0 0 0 85.334 0v-85.333A42.667 42.667 0 0 0 512 768zm244.48-79.36a42.667 42.667 0 0 0-59.307 61.44l61.44 60.587a42.667 42.667 0 0 0 29.44 11.946 42.667 42.667 0 0 0 30.72-12.8 42.667 42.667 0 0 0 0-60.586zm-488.96 0-61.44 59.307a42.667 42.667 0 0 0 0 60.586 42.667 42.667 0 0 0 30.72 12.8 42.667 42.667 0 0 0 28.587-10.666l61.44-59.307a42.667 42.667 0 0 0-59.307-61.44zM512 341.333A170.667 170.667 0 1 0 682.667 512 170.667 170.667 0 0 0 512 341.333z" fill="currentColor"></path></svg></div> <div class="item auto active"><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" class="icon auto-icon"><path d="M460.864 539.072H564.8L510.592 376l-49.728 163.072zM872 362.368V149.504H659.648L510.528 0l-149.12 149.504H149.12v212.928L0 511.872l149.12 149.504v212.928h212.352l149.12 149.504 149.12-149.504h212.352V661.376l149.12-149.504L872 362.368zM614.464 693.12l-31.616-90.624H438.272l-31.616 90.624h-85.888l144.576-407.68h90.368l144.576 407.68h-85.824zm0 0" fill="currentColor"></path></svg></div> <div class="item night"><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" class="icon dark-icon"><path d="M935.539 630.402c-11.43-11.432-28.674-14.739-43.531-8.354-46.734 20.103-96.363 30.297-147.508 30.297-99.59 0-193.221-38.784-263.64-109.203-108.637-108.637-139.61-270.022-78.908-411.148a39.497 39.497 0 0 0-51.886-51.887c-52.637 22.64-100.017 54.81-140.826 95.616-85.346 85.346-132.346 198.821-132.346 319.52 0 120.7 47.001 234.172 132.347 319.519S408.063 947.11 528.76 947.11c120.7 0 234.172-47.003 319.52-132.351 40.809-40.81 72.978-88.19 95.616-140.826a39.497 39.497 0 0 0-8.356-43.532z" fill="currentColor"></path></svg></div></div> <!----></div></div></div></button> <div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link router-link-active"><!---->
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="文档中心" class="dropdown-title"><span class="title"><!---->
        文档中心
      </span> <span class="arrow"></span></button> <ul class="nav-dropdown"><li class="dropdown-item"><a href="http://open.weharmonyos.com/zh-cn/readme/Readme-CN.html" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  子系统
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><a href="http://open.weharmonyos.com/zh-cn/device-dev/website.html" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  南向
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><a href="http://open.weharmonyos.com/zh-cn/application-dev/website.html" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  北向
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="博客中心" class="dropdown-title"><span class="title"><!---->
        博客中心
      </span> <span class="arrow"></span></button> <ul class="nav-dropdown"><li class="dropdown-item"><a href="/blog/101.html" class="nav-link"><!---->
  总目录
</a></li><li class="dropdown-item"><a href="/blog/index/1_base.html" class="nav-link"><!---->
  基础知识
</a></li><li class="dropdown-item"><a href="/blog/index/2_process.html" class="nav-link"><!---->
  进程管理
</a></li><li class="dropdown-item"><a href="/blog/index/3_task.html" class="nav-link"><!---->
  任务管理
</a></li><li class="dropdown-item"><a href="/blog/index/4_mem.html" class="nav-link"><!---->
  内存管理
</a></li><li class="dropdown-item"><a href="/blog/index/5_ipc.html" class="nav-link"><!---->
  进程通讯
</a></li><li class="dropdown-item"><a href="/blog/index/6_fs.html" class="nav-link"><!---->
  文件系统
</a></li><li class="dropdown-item"><a href="/blog/index/7_hw.html" class="nav-link"><!---->
  软硬接口
</a></li><li class="dropdown-item"><a href="/blog/index/8_asm.html" class="nav-link"><!---->
  内核汇编
</a></li><li class="dropdown-item"><a href="/blog/index/9_run.html" class="nav-link"><!---->
  编译运行
</a></li><li class="dropdown-item"><a href="/blog/index/10_test.html" class="nav-link"><!---->
  调测工具
</a></li><li class="dropdown-item"><a href="/blog/index/0_so.html" class="nav-link"><!---->
  前因后果
</a></li><li class="dropdown-item"><a href="/extsite.html" class="nav-link"><!---->
  前往 &gt;&gt; 外站
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="论坛中心" class="dropdown-title"><span class="title"><!---->
        论坛中心
      </span> <span class="arrow"></span></button> <ul class="nav-dropdown"><li class="dropdown-item"><a href="http://bbs.weharmonyos.com" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  论坛首页
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><a href="http://bbs.weharmonyos.com/forum-42-1.html" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  问题建议
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="手册中心" class="dropdown-title"><span class="title"><!---->
        手册中心
      </span> <span class="arrow"></span></button> <ul class="nav-dropdown"><li class="dropdown-item"><a href="http://doxygen.weharmonyos.com/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  内核参考手册
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><a href="/compile/assembly.html" class="nav-link"><!---->
  gnu 汇编教程
</a></li><li class="dropdown-item"><a href="/compile/gn/docs/" class="nav-link"><!---->
  gn 参考手册
</a></li><li class="dropdown-item"><a href="/compile/ninja/Readme-CN.html" class="nav-link"><!---->
  ninja 参考手册
</a></li><li class="dropdown-item"><a href="/compile/fhs.html" class="nav-link"><!---->
  fhs 规范
</a></li></ul></div></div><div class="nav-item"><a href="/donate.html" class="nav-link"><!---->
  赞助中心
</a></div></nav> <!----> <!----> <!----> <div class="content__navbar-end"></div></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><!----> <!----> <div class="content__sidebar-top"></div> <nav class="sidebar-nav-links"><div class="nav-item"><a href="/" class="nav-link router-link-active"><!---->
  首页
</a></div><div class="nav-item"><div class="mobile-dropdown-wrapper"><button type="button" aria-label="文档中心" class="dropdown-title"><span class="title"><!---->
      文档中心
    </span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="http://open.weharmonyos.com/zh-cn/readme/Readme-CN.html" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  子系统
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="http://open.weharmonyos.com/zh-cn/device-dev/website.html" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  南向
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="http://open.weharmonyos.com/zh-cn/application-dev/website.html" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  北向
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div><div class="nav-item"><div class="mobile-dropdown-wrapper"><button type="button" aria-label="博客中心" class="dropdown-title"><span class="title"><!---->
      博客中心
    </span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/blog/101.html" class="nav-link"><!---->
  总目录
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/1_base.html" class="nav-link"><!---->
  基础知识
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/2_process.html" class="nav-link"><!---->
  进程管理
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/3_task.html" class="nav-link"><!---->
  任务管理
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/4_mem.html" class="nav-link"><!---->
  内存管理
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/5_ipc.html" class="nav-link"><!---->
  进程通讯
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/6_fs.html" class="nav-link"><!---->
  文件系统
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/7_hw.html" class="nav-link"><!---->
  软硬接口
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/8_asm.html" class="nav-link"><!---->
  内核汇编
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/9_run.html" class="nav-link"><!---->
  编译运行
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/10_test.html" class="nav-link"><!---->
  调测工具
</a></li><li class="dropdown-item"><!----> <a href="/blog/index/0_so.html" class="nav-link"><!---->
  前因后果
</a></li><li class="dropdown-item"><!----> <a href="/extsite.html" class="nav-link"><!---->
  前往 &gt;&gt; 外站
</a></li></ul></div></div><div class="nav-item"><div class="mobile-dropdown-wrapper"><button type="button" aria-label="论坛中心" class="dropdown-title"><span class="title"><!---->
      论坛中心
    </span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="http://bbs.weharmonyos.com" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  论坛首页
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="http://bbs.weharmonyos.com/forum-42-1.html" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  问题建议
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div><div class="nav-item"><div class="mobile-dropdown-wrapper"><button type="button" aria-label="手册中心" class="dropdown-title"><span class="title"><!---->
      手册中心
    </span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="http://doxygen.weharmonyos.com/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external"><!---->
  内核参考手册
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="/compile/assembly.html" class="nav-link"><!---->
  gnu 汇编教程
</a></li><li class="dropdown-item"><!----> <a href="/compile/gn/docs/" class="nav-link"><!---->
  gn 参考手册
</a></li><li class="dropdown-item"><!----> <a href="/compile/ninja/Readme-CN.html" class="nav-link"><!---->
  ninja 参考手册
</a></li><li class="dropdown-item"><!----> <a href="/compile/fhs.html" class="nav-link"><!---->
  fhs 规范
</a></li></ul></div></div><div class="nav-item"><a href="/donate.html" class="nav-link"><!---->
  赞助中心
</a></div> <!----></nav> <!----> <div class="content__sidebar-center"></div> <ul class="sidebar-links"><li><a href="/blog/101.html" class="sidebar-link">总目录</a></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable"><!----> <span class="title">基础知识 | 10</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable"><!----> <span class="title">进程管理 | 10</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable"><!----> <span class="title">任务管理 | 10</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable"><!----> <span class="title">内存管理 | 10</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable"><!----> <span class="title">通讯机制 | 14</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable"><!----> <span class="title">文件系统 | 10</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable"><!----> <span class="title">硬件架构 | 9</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable"><!----> <span class="title">内核汇编 | 10</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable"><!----> <span class="title">编译运行 | 13</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable"><!----> <span class="title">调测工具 | 4</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading clickable open"><!----> <span class="title">前因后果 | 4</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/blog/index/0_so.html" class="sidebar-link">本章目录</a></li><li><a href="/blog/101.html" class="sidebar-link">总目录</a></li><li><a href="/blog/102.html" aria-current="page" class="active sidebar-link">源码注释</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/blog/103.html" class="sidebar-link">静态站点</a></li><li><a href="/blog/104.html" class="sidebar-link">参考文档</a></li></ul></section></li></ul> <!----> <div class="content__sidebar-bottom"></div> <!----></aside> <main class="page"><nav class="breadcrumb disable"><!----></nav> <!----> <div class="content__page-top"></div> <div vocab="https://schema.org/" typeof="Article" class="page-title"><h1><!----> <span property="headline"></span></h1> <div class="page-info"><!----> </div> <!----> <hr></div> <div class="anchor-place-holder"><aside id="anchor"><div class="anchor-wrapper"><ul class="anchor-list"><li class="anchor"><a href="/blog/102.html#为何要精读内核源码" class="anchor-link heading3"><div>为何要精读内核源码？</div></a></li><li class="anchor"><a href="/blog/102.html#热爱是所有的理由和答案" class="anchor-link heading3"><div>热爱是所有的理由和答案</div></a></li><li class="anchor"><a href="/blog/102.html#〃・ิ‿・ิ-ゞ鸿蒙内核开发者" class="anchor-link heading3"><div>(〃･ิ‿･ิ)ゞ鸿蒙内核开发者</div></a></li><li class="anchor"><a href="/blog/102.html#理解内核的三个层级" class="anchor-link heading3"><div>理解内核的三个层级</div></a></li><li class="anchor"><a href="/blog/102.html#四个维度解剖内核" class="anchor-link heading3"><div>四个维度解剖内核</div></a></li><li class="anchor"><a href="/blog/102.html#鸿蒙论坛-干净-营养-不盲从" class="anchor-link heading3"><div>鸿蒙论坛 | 干净.营养.不盲从</div></a></li><li class="anchor"><a href="/blog/102.html#四大码仓发布-源码同步官方" class="anchor-link heading3"><div>四大码仓发布 | 源码同步官方</div></a></li><li class="anchor"><a href="/blog/102.html#注解子系统仓库" class="anchor-link heading3"><div>注解子系统仓库</div></a></li><li class="anchor"><a href="/blog/102.html#关于-zzz-目录" class="anchor-link heading3"><div>关于 zzz 目录</div></a></li><li class="anchor"><a href="/blog/102.html#官方文档-静态站点呈现" class="anchor-link heading3"><div>官方文档 | 静态站点呈现</div></a></li></ul></div></aside></div> <!----> <div class="content__content-top"></div> <div class="theme-default-content content__default"><p><a href="https://gitee.com/weharmony/kernel_liteos_a_note/wikis" target="_blank" rel="noopener noreferrer"><img src="https://weharmonyos.oss-cn-hangzhou.aliyuncs.com/resources/common/io.png" alt=""></a></p> <p><strong>中文注解鸿蒙内核 | <a href="https://gitee.com/weharmony/kernel_liteos_a_note" target="_blank" rel="noopener noreferrer">kernel_liteos_a_note</a></strong> 是在 <code>OpenHarmony</code> 的 <a href="https://gitee.com/openharmony/kernel_liteos_a" target="_blank" rel="noopener noreferrer">kernel_liteos_a</a> 基础上给内核源码加上中文注解的版本，同步官方代码迭代推进。</p> <h3 id="为何要精读内核源码">为何要精读内核源码？</h3> <ul><li>码农的学职生涯，都应精读一遍内核源码。以浇筑好计算机知识大厦的地基，地基纵深的坚固程度，很大程度能决定未来大厦能盖多高。那为何一定要精读细品呢？</li> <li>因为内核代码本身并不太多，都是浓缩的精华，精读是让各个知识点高频出现，不孤立成点状记忆，没有足够连接点的知识点是很容易忘的，点点成线，线面成体，连接越多，记得越牢，如此短时间内容易结成一张高浓度，高密度的系统化知识网，训练大脑肌肉记忆，驻入大脑直觉区，想抹都抹不掉，终生携带，随时调取。跟骑单车一样，一旦学会，即便多年不骑，照样跨上就走，游刃有余。</li></ul> <h3 id="热爱是所有的理由和答案">热爱是所有的理由和答案</h3> <ul><li><p>因大学时阅读 linux 2.6 内核痛并快乐的经历，一直有个心愿，对底层基础技术进行一次系统性的整理，方便自己随时翻看，同时让更多对底层感兴趣的小伙伴减少时间，加速对计算机系统级的理解，而不至于过早的放弃。但因过程种种，多年一直没有行动，基本要放弃这件事了。恰逢 2020/9/10 鸿蒙正式开源，重新激活了多年的心愿，就有那么点如黄河之水一发不可收拾了。</p></li> <li><p>包含三部分内容：<strong>注源</strong>，<strong>写博</strong> ，<strong>画图</strong>， 目前对内核源码的注解完成 80% ，博客分析完成80+篇，百图画鸿蒙完成20张，空闲时间几乎被占用，时间不够用，但每天都很充实，连做梦鸿蒙系统都在鱼贯而入。是件很有挑战的事，时间单位以年计，已持续一年半，期间得到众多小伙伴的支持与纠错，在此谢过 ! 😛</p></li></ul> <h3 id="〃・ิ‿・ิ-ゞ鸿蒙内核开发者">(〃･ิ‿･ิ)ゞ鸿蒙内核开发者</h3> <ul><li>感谢开放原子开源基金会，致敬鸿蒙内核开发者提供了如此优秀的源码，一了多年的夙愿，津津乐道于此。从内核一行行的代码中能深深感受到开发者各中艰辛与坚持，及鸿蒙生态对未来的价值，这些是张嘴就来的网络喷子们永远不能体会到的。可以毫不夸张的说鸿蒙内核源码可作为大学：C语言，数据结构，操作系统，汇编语言，计算机系统结构，计算机组成原理，微机接口 七门课程的教学项目。如此宝库，不深入研究实在是暴殄天物，于心不忍，坚信鸿蒙大势所趋，未来可期，其必定成功，也必然成功，誓做其坚定的追随者和传播者。</li></ul> <h3 id="理解内核的三个层级">理解内核的三个层级</h3> <ul><li>普通概念映射级：这一级不涉及专业知识，用大众所熟知的公共认知就能听明白是个什么概念，也就是说用一个普通人都懂的概念去诠释或者映射一个他们从没听过的概念。让陌生的知识点与大脑中烂熟于心的知识点建立多重链接，加深记忆。说别人能听得懂的话这很重要。一个没学过计算机知识的卖菜大妈就不可能知道内核的基本运作了吗？不一定。在系列篇中试图用故事，打比方，去引导这一层级的认知，希望能卷入更多的人来关注基础软件，人多了场子热起来了创新就来了。</li> <li>专业概念抽象级：对抽象的专业逻辑概念具体化认知， 比如虚拟内存，老百姓是听不懂的，学过计算机的人都懂，具体怎么实现的很多人又都不懂了，但这并不妨碍成为一个优秀的上层应用开发者，因为虚拟内存已经被抽象出来，目的是要屏蔽上层对它具体实现的认知。试图用百篇博客系列篇去拆解那些已经被抽象出来的专业概念， 希望能卷入更多对内核感兴趣的应用软件人才流入基础软硬件生态， 应用软件咱们是无敌宇宙，但基础软件却很薄弱。</li> <li>具体微观代码级：这一级是具体到每一行代码的实现，到了用代码指令级的地步，这段代码是什么意思？为什么要这么设计？有没有更好的方案？<a href="https://gitee.com/weharmony/kernel_liteos_a_note" target="_blank" rel="noopener noreferrer">鸿蒙内核源码注解分析</a> 试图从细微处去解释代码实现层，英文真的是天生适合设计成编程语言的人类语言，计算机的01码映射到人类世界的26个字母，诞生了太多的伟大奇迹。但我们的母语注定了很大部分人存在着自然语言层级的理解映射，希望内核注解分析能让更多爱好者节约时间成本，哪怕节约一分钟也是这件事莫大的意义。</li></ul> <h3 id="四个维度解剖内核">四个维度解剖内核</h3> <p>为了全方位剖析内核，在 <strong>画图</strong>，<strong>写文</strong>，<strong>注源</strong>，<strong>成册</strong> 四个方向做了努力，试图以<strong>讲故事</strong>，<strong>画图表</strong>，<strong>写文档</strong>，<strong>拆源码</strong> 立体的方式表述内核。很喜欢易中天老师的一句话:研究方式不等于表述方式。底层技术并不枯燥，它可以很有意思，它可以是我们生活中的场景。</p> <h4 id="一-百图画鸿蒙-一图一主干-骨骼系统">一： 百图画鸿蒙 | 一图一主干 | 骨骼系统</h4> <ul><li>如果把鸿蒙比作人，百图目的是要画出其骨骼系统。</li> <li>百图系列每张图都是心血之作，耗时甚大，能用一张就绝不用两张，所以会画的比较复杂，高清图会很大，可在公众号中回复 <strong>百图</strong> 获取<code>3</code>倍超高清最新图。<code>v**.xx</code>代表图的版本，请留意图的更新。</li> <li>例如： <strong>双向链表</strong> 是内核最重要的结构体，站长更愿意将它比喻成人的左右手，其意义是通过寄生在宿主结构体上来体现，可想象成在宿主结构体装上一对对勤劳的双手，它真的很会来事，超级活跃分子，为宿主到处拉朋友，建圈子。其插入 | 删除 | 遍历操作是它最常用的社交三大件，若不理解透彻在分析源码过程中很容易卡壳。虽在网上能找到很多它的图,但怎么看都不是自己想要的，干脆重画了它的主要操作。</li> <li><img src="https://weharmonyos.oss-cn-hangzhou.aliyuncs.com/resources/100pic/1_list.png" alt=""></li></ul> <h4 id="二-百文说内核-抓住主脉络-肌肉器官">二： 百文说内核 | 抓住主脉络 | 肌肉器官</h4> <ul><li><p>百文相当于摸出内核的肌肉和器官系统，让人开始丰满有立体感，因是直接从注释源码起步，在加注释过程中，每每有心得处就整理,慢慢形成了以下文章。内容立足源码，常以生活场景打比方尽可能多的将内核知识点置入某种场景，具有画面感，容易理解记忆。说别人能听得懂的话很重要! 百篇博客绝不是百度教条式的在说一堆诘屈聱牙的概念，那没什么意思。更希望让内核变得栩栩如生，倍感亲切。</p></li> <li><p>与代码需不断<code>debug</code>一样，文章内容会存在不少错漏之处，请多包涵，但会反复修正，持续更新，<code>v**.xx</code> 代表文章序号和修改的次数，精雕细琢，言简意赅，力求打造精品内容。</p></li> <li><p>百文在 &lt; 鸿蒙研究站 | 开源中国 | 博客园 | 51cto | csdn | 知乎 | 掘金 &gt; 站点发布，公众号回复 <strong>百文</strong> 可方便阅读。</p></li> <li><p><img src="https://weharmonyos.oss-cn-hangzhou.aliyuncs.com/resources/common/cate.png" alt=""></p></li></ul> <p><strong>基础知识</strong></p> <ul><li><a href="http://weharmonyos.com/blog/01.html" target="_blank" rel="noopener noreferrer">v01.12 鸿蒙内核源码分析(双向链表) | 谁是内核最重要结构体</a></li> <li><a href="http://weharmonyos.com/blog/02.html" target="_blank" rel="noopener noreferrer">v02.01 鸿蒙内核源码分析(内核概念) | 名不正则言不顺</a></li> <li><a href="http://weharmonyos.com/blog/03.html" target="_blank" rel="noopener noreferrer">v03.02 鸿蒙内核源码分析(源码结构) | 宏观尺度看内核结构</a></li> <li><a href="http://weharmonyos.com/blog/04.html" target="_blank" rel="noopener noreferrer">v04.01 鸿蒙内核源码分析(地址空间) | 内核如何看待空间</a></li> <li><a href="http://weharmonyos.com/blog/05.html" target="_blank" rel="noopener noreferrer">v05.03 鸿蒙内核源码分析(计时单位) | 内核如何看待时间</a></li> <li><a href="http://weharmonyos.com/blog/06.html" target="_blank" rel="noopener noreferrer">v06.01 鸿蒙内核源码分析(优雅的宏) | 编译器也喜欢复制粘贴 </a></li> <li><a href="http://weharmonyos.com/blog/07.html" target="_blank" rel="noopener noreferrer">v07.01 鸿蒙内核源码分析(钩子框架) | 万物皆可HOOK </a></li> <li><a href="http://weharmonyos.com/blog/08.html" target="_blank" rel="noopener noreferrer">v08.04 鸿蒙内核源码分析(位图管理) | 一分钱被掰成八半使用</a></li> <li><a href="http://weharmonyos.com/blog/09.html" target="_blank" rel="noopener noreferrer">v09.01 鸿蒙内核源码分析(POSIX) | 操作系统界的话事人 </a></li> <li><a href="http://weharmonyos.com/blog/10.html" target="_blank" rel="noopener noreferrer">v10.01 鸿蒙内核源码分析(main函数) | 要走了无数码农的第一次 </a></li></ul> <p><strong>进程管理</strong></p> <ul><li><a href="http://weharmonyos.com/blog/11.html" target="_blank" rel="noopener noreferrer">v11.04 鸿蒙内核源码分析(调度故事) | 大郎，该喝药了</a></li> <li><a href="http://weharmonyos.com/blog/12.html" target="_blank" rel="noopener noreferrer">v12.03 鸿蒙内核源码分析(进程控制块) | 可怜天下父母心</a></li> <li><a href="http://weharmonyos.com/blog/13.html" target="_blank" rel="noopener noreferrer">v13.01 鸿蒙内核源码分析(进程空间) | 有爱的地方才叫家 </a></li> <li><a href="http://weharmonyos.com/blog/14.html" target="_blank" rel="noopener noreferrer">v14.01 鸿蒙内核源码分析(线性区) | 人要有空间才能好好相处</a></li> <li><a href="http://weharmonyos.com/blog/15.html" target="_blank" rel="noopener noreferrer">v15.01 鸿蒙内核源码分析(红黑树) | 众里寻他千百度 </a></li> <li><a href="http://weharmonyos.com/blog/16.html" target="_blank" rel="noopener noreferrer">v16.06 鸿蒙内核源码分析(进程管理) | 家家有本难念的经</a></li> <li><a href="http://weharmonyos.com/blog/17.html" target="_blank" rel="noopener noreferrer">v17.05 鸿蒙内核源码分析(Fork进程) | 一次调用 两次返回</a></li> <li><a href="http://weharmonyos.com/blog/18.html" target="_blank" rel="noopener noreferrer">v18.02 鸿蒙内核源码分析(进程回收) | 临终托孤的短命娃</a></li> <li><a href="http://weharmonyos.com/blog/19.html" target="_blank" rel="noopener noreferrer">v19.03 鸿蒙内核源码分析(Shell编辑) | 两个任务 三个阶段</a></li> <li><a href="http://weharmonyos.com/blog/20.html" target="_blank" rel="noopener noreferrer">v20.01 鸿蒙内核源码分析(Shell解析) | 应用窥伺内核的窗口</a></li></ul> <p><strong>任务管理</strong></p> <ul><li><a href="http://weharmonyos.com/blog/21.html" target="_blank" rel="noopener noreferrer">v21.07 鸿蒙内核源码分析(任务控制块) | 内核最重要的概念</a></li> <li><a href="http://weharmonyos.com/blog/22.html" target="_blank" rel="noopener noreferrer">v22.05 鸿蒙内核源码分析(并发并行) | 如何搞清楚它俩区分</a></li> <li><a href="http://weharmonyos.com/blog/23.html" target="_blank" rel="noopener noreferrer">v23.03 鸿蒙内核源码分析(就绪队列) | 美好的事物永远值得等待</a></li> <li><a href="http://weharmonyos.com/blog/24.html" target="_blank" rel="noopener noreferrer">v24.08 鸿蒙内核源码分析(调度机制) | 公平是相对的</a></li> <li><a href="http://weharmonyos.com/blog/25.html" target="_blank" rel="noopener noreferrer">v25.05 鸿蒙内核源码分析(任务管理) | 如何管理任务池</a></li> <li><a href="http://weharmonyos.com/blog/26.html" target="_blank" rel="noopener noreferrer">v26.03 鸿蒙内核源码分析(用栈方式) | 谁来提供程序运行场地</a></li> <li><a href="http://weharmonyos.com/blog/27.html" target="_blank" rel="noopener noreferrer">v27.02 鸿蒙内核源码分析(软件定时器) | 内核最高级任务竟是它</a></li> <li><a href="http://weharmonyos.com/blog/28.html" target="_blank" rel="noopener noreferrer">v28.01 鸿蒙内核源码分析(控制台) | 一个让很多人模糊的概念</a></li> <li><a href="http://weharmonyos.com/blog/29.html" target="_blank" rel="noopener noreferrer">v29.01 鸿蒙内核源码分析(远程登录) | 内核如何接待远方的客人</a></li> <li><a href="http://weharmonyos.com/blog/30.html" target="_blank" rel="noopener noreferrer">v30.01 鸿蒙内核源码分析(协议栈) | 正在制作中 ... </a></li></ul> <p><strong>内存管理</strong></p> <ul><li><a href="http://weharmonyos.com/blog/31.html" target="_blank" rel="noopener noreferrer">v31.02 鸿蒙内核源码分析(内存规则) | 内存管理到底在管什么</a></li> <li><a href="http://weharmonyos.com/blog/32.html" target="_blank" rel="noopener noreferrer">v32.04 鸿蒙内核源码分析(物理内存) | 真实的可不一定精彩</a></li> <li><a href="http://weharmonyos.com/blog/33.html" target="_blank" rel="noopener noreferrer">v33.04 鸿蒙内核源码分析(内存概念) | RAM &amp; ROM &amp; Flash</a></li> <li><a href="http://weharmonyos.com/blog/34.html" target="_blank" rel="noopener noreferrer">v34.03 鸿蒙内核源码分析(虚实映射) | 映射是伟大的发明</a></li> <li><a href="http://weharmonyos.com/blog/35.html" target="_blank" rel="noopener noreferrer">v35.02 鸿蒙内核源码分析(页表管理) | 映射关系保存在哪</a></li> <li><a href="http://weharmonyos.com/blog/36.html" target="_blank" rel="noopener noreferrer">v36.03 鸿蒙内核源码分析(静态分配) | 很简单的一位小朋友</a></li> <li><a href="http://weharmonyos.com/blog/37.html" target="_blank" rel="noopener noreferrer">v37.01 鸿蒙内核源码分析(TLFS算法) | 图表解读TLFS原理 </a></li> <li><a href="http://weharmonyos.com/blog/38.html" target="_blank" rel="noopener noreferrer">v38.01 鸿蒙内核源码分析(内存池管理) | 如何高效切割合并内存块 </a></li> <li><a href="http://weharmonyos.com/blog/39.html" target="_blank" rel="noopener noreferrer">v39.04 鸿蒙内核源码分析(原子操作) | 谁在守护指令执行的完整性</a></li> <li><a href="http://weharmonyos.com/blog/40.html" target="_blank" rel="noopener noreferrer">v40.01 鸿蒙内核源码分析(圆整对齐) | 正在制作中 ... </a></li></ul> <p><strong>通讯机制</strong></p> <ul><li><a href="http://weharmonyos.com/blog/41.html" target="_blank" rel="noopener noreferrer">v41.04 鸿蒙内核源码分析(通讯总览) | 内核跟人一样都喜欢八卦</a></li> <li><a href="http://weharmonyos.com/blog/42.html" target="_blank" rel="noopener noreferrer">v42.08 鸿蒙内核源码分析(自旋锁) | 死等丈夫归来的贞洁烈女</a></li> <li><a href="http://weharmonyos.com/blog/43.html" target="_blank" rel="noopener noreferrer">v43.05 鸿蒙内核源码分析(互斥锁) | 有你没她 相安无事</a></li> <li><a href="http://weharmonyos.com/blog/44.html" target="_blank" rel="noopener noreferrer">v44.02 鸿蒙内核源码分析(快锁使用) | 用户态负责快锁逻辑</a></li> <li><a href="http://weharmonyos.com/blog/45.html" target="_blank" rel="noopener noreferrer">v45.02 鸿蒙内核源码分析(快锁实现) | 内核态负责快锁调度</a></li> <li><a href="http://weharmonyos.com/blog/46.html" target="_blank" rel="noopener noreferrer">v46.01 鸿蒙内核源码分析(读写锁) | 内核如何实现多读单写</a></li> <li><a href="http://weharmonyos.com/blog/47.html" target="_blank" rel="noopener noreferrer">v47.05 鸿蒙内核源码分析(信号量) | 谁在解决任务间的同步</a></li> <li><a href="http://weharmonyos.com/blog/48.html" target="_blank" rel="noopener noreferrer">v48.07 鸿蒙内核源码分析(事件机制) | 多对多任务如何同步</a></li> <li><a href="http://weharmonyos.com/blog/49.html" target="_blank" rel="noopener noreferrer">v49.05 鸿蒙内核源码分析(信号生产) | 年过半百 活力十足</a></li> <li><a href="http://weharmonyos.com/blog/50.html" target="_blank" rel="noopener noreferrer">v50.03 鸿蒙内核源码分析(信号消费) | 谁让CPU连续四次换栈运行</a></li> <li><a href="http://weharmonyos.com/blog/51.html" target="_blank" rel="noopener noreferrer">v51.03 鸿蒙内核源码分析(消息队列) | 进程间如何异步传递大数据</a></li> <li><a href="http://weharmonyos.com/blog/52.html" target="_blank" rel="noopener noreferrer">v52.02 鸿蒙内核源码分析(消息封装) | 剖析LiteIpc(上)进程通讯内容</a></li> <li><a href="http://weharmonyos.com/blog/53.html" target="_blank" rel="noopener noreferrer">v53.01 鸿蒙内核源码分析(消息映射) | 剖析LiteIpc(下)进程通讯机制</a></li> <li><a href="http://weharmonyos.com/blog/54.html" target="_blank" rel="noopener noreferrer">v54.01 鸿蒙内核源码分析(共享内存) | 进程间最快通讯方式</a></li></ul> <p><strong>文件系统</strong></p> <ul><li><a href="http://weharmonyos.com/blog/55.html" target="_blank" rel="noopener noreferrer">v55.02 鸿蒙内核源码分析(文件概念) | 为什么说一切皆是文件</a></li> <li><a href="http://weharmonyos.com/blog/56.html" target="_blank" rel="noopener noreferrer">v56.04 鸿蒙内核源码分析(文件故事) | 用图书管理说文件系统</a></li> <li><a href="http://weharmonyos.com/blog/57.html" target="_blank" rel="noopener noreferrer">v57.06 鸿蒙内核源码分析(索引节点) | 谁是文件系统最重要的概念</a></li> <li><a href="http://weharmonyos.com/blog/58.html" target="_blank" rel="noopener noreferrer">v58.02 鸿蒙内核源码分析(VFS) | 文件系统的话事人</a></li> <li><a href="http://weharmonyos.com/blog/59.html" target="_blank" rel="noopener noreferrer">v59.04 鸿蒙内核源码分析(文件句柄) | 你为什么叫句柄</a></li> <li><a href="http://weharmonyos.com/blog/60.html" target="_blank" rel="noopener noreferrer">v60.07 鸿蒙内核源码分析(根文件系统) | 谁先挂到<code>/</code>谁就是老大</a></li> <li><a href="http://weharmonyos.com/blog/61.html" target="_blank" rel="noopener noreferrer">v61.05 鸿蒙内核源码分析(挂载机制) | 随根逐流不掉队</a></li> <li><a href="http://weharmonyos.com/blog/62.html" target="_blank" rel="noopener noreferrer">v62.05 鸿蒙内核源码分析(管道文件) | 如何降低数据流动成本</a></li> <li><a href="http://weharmonyos.com/blog/63.html" target="_blank" rel="noopener noreferrer">v63.03 鸿蒙内核源码分析(文件映射) | 正在制作中 ... </a></li> <li><a href="http://weharmonyos.com/blog/64.html" target="_blank" rel="noopener noreferrer">v64.01 鸿蒙内核源码分析(写时拷贝) | 正在制作中 ... </a></li></ul> <p><strong>硬件架构</strong></p> <ul><li><a href="http://weharmonyos.com/blog/65.html" target="_blank" rel="noopener noreferrer">v65.01 鸿蒙内核源码分析(芯片模式) | 回顾芯片行业各位大佬</a></li> <li><a href="http://weharmonyos.com/blog/66.html" target="_blank" rel="noopener noreferrer">v66.03 鸿蒙内核源码分析(ARM架构) | ARMv7 &amp; Cortex(A|R|M)</a></li> <li><a href="http://weharmonyos.com/blog/67.html" target="_blank" rel="noopener noreferrer">v67.01 鸿蒙内核源码分析(指令集) | CICS PK RICS</a></li> <li><a href="http://weharmonyos.com/blog/68.html" target="_blank" rel="noopener noreferrer">v68.01 鸿蒙内核源码分析(协处理器) | CPU的好帮手 </a></li> <li><a href="http://weharmonyos.com/blog/69.html" target="_blank" rel="noopener noreferrer">v69.05 鸿蒙内核源码分析(工作模式) | 角色不同 责任不同</a></li> <li><a href="http://weharmonyos.com/blog/70.html" target="_blank" rel="noopener noreferrer">v70.06 鸿蒙内核源码分析(寄存器) | 世界被它们玩出了花</a></li> <li><a href="http://weharmonyos.com/blog/71.html" target="_blank" rel="noopener noreferrer">v71.03 鸿蒙内核源码分析(多核管理) | 并发真正的基础</a></li> <li><a href="http://weharmonyos.com/blog/72.html" target="_blank" rel="noopener noreferrer">v72.05 鸿蒙内核源码分析(中断概念) | 海公公的日常工作</a></li> <li><a href="http://weharmonyos.com/blog/73.html" target="_blank" rel="noopener noreferrer">v73.04 鸿蒙内核源码分析(中断管理) | 没中断太可怕</a></li></ul> <p><strong>内核汇编</strong></p> <ul><li><a href="http://weharmonyos.com/blog/74.html" target="_blank" rel="noopener noreferrer">v74.01 鸿蒙内核源码分析(编码方式) | 机器指令是如何编码的 </a></li> <li><a href="http://weharmonyos.com/blog/75.html" target="_blank" rel="noopener noreferrer">v75.03 鸿蒙内核源码分析(汇编基础) | CPU上班也要打卡</a></li> <li><a href="http://weharmonyos.com/blog/76.html" target="_blank" rel="noopener noreferrer">v76.04 鸿蒙内核源码分析(汇编传参) | 如何传递复杂的参数</a></li> <li><a href="http://weharmonyos.com/blog/77.html" target="_blank" rel="noopener noreferrer">v77.01 鸿蒙内核源码分析(链接脚本) | 正在制作中 ... </a></li> <li><a href="http://weharmonyos.com/blog/78.html" target="_blank" rel="noopener noreferrer">v78.01 鸿蒙内核源码分析(内核启动) | 从汇编到main()</a></li> <li><a href="http://weharmonyos.com/blog/79.html" target="_blank" rel="noopener noreferrer">v79.01 鸿蒙内核源码分析(进程切换) | 正在制作中 ... </a></li> <li><a href="http://weharmonyos.com/blog/80.html" target="_blank" rel="noopener noreferrer">v80.03 鸿蒙内核源码分析(任务切换) | 看汇编如何切换任务</a></li> <li><a href="http://weharmonyos.com/blog/81.html" target="_blank" rel="noopener noreferrer">v81.05 鸿蒙内核源码分析(中断切换) | 系统因中断活力四射</a></li> <li><a href="http://weharmonyos.com/blog/82.html" target="_blank" rel="noopener noreferrer">v82.06 鸿蒙内核源码分析(异常接管) | 社会很单纯 复杂的是人</a></li> <li><a href="http://weharmonyos.com/blog/83.html" target="_blank" rel="noopener noreferrer">v83.01 鸿蒙内核源码分析(缺页中断) | 正在制作中 ... </a></li></ul> <p><strong>编译运行</strong></p> <ul><li><a href="http://weharmonyos.com/blog/84.html" target="_blank" rel="noopener noreferrer">v84.02 鸿蒙内核源码分析(编译过程) | 简单案例说透中间过程</a></li> <li><a href="http://weharmonyos.com/blog/85.html" target="_blank" rel="noopener noreferrer">v85.03 鸿蒙内核源码分析(编译构建) | 编译鸿蒙防掉坑指南</a></li> <li><a href="http://weharmonyos.com/blog/86.html" target="_blank" rel="noopener noreferrer">v86.04 鸿蒙内核源码分析(GN语法) | 如何构建鸿蒙系统</a></li> <li><a href="http://weharmonyos.com/blog/87.html" target="_blank" rel="noopener noreferrer">v87.03 鸿蒙内核源码分析(忍者无敌) | 忍者的特点就是一个字</a></li> <li><a href="http://weharmonyos.com/blog/88.html" target="_blank" rel="noopener noreferrer">v88.04 鸿蒙内核源码分析(ELF格式) | 应用程序入口并非main</a></li> <li><a href="http://weharmonyos.com/blog/89.html" target="_blank" rel="noopener noreferrer">v89.03 鸿蒙内核源码分析(ELF解析) | 敢忘了她姐俩你就不是银</a></li> <li><a href="http://weharmonyos.com/blog/90.html" target="_blank" rel="noopener noreferrer">v90.04 鸿蒙内核源码分析(静态链接) | 一个小项目看中间过程</a></li> <li><a href="http://weharmonyos.com/blog/91.html" target="_blank" rel="noopener noreferrer">v91.04 鸿蒙内核源码分析(重定位) | 与国际接轨的对外发言人</a></li> <li><a href="http://weharmonyos.com/blog/92.html" target="_blank" rel="noopener noreferrer">v92.01 鸿蒙内核源码分析(动态链接) | 正在制作中 ... </a></li> <li><a href="http://weharmonyos.com/blog/93.html" target="_blank" rel="noopener noreferrer">v93.05 鸿蒙内核源码分析(进程映像) | 程序是如何被加载运行的</a></li> <li><a href="http://weharmonyos.com/blog/94.html" target="_blank" rel="noopener noreferrer">v94.01 鸿蒙内核源码分析(应用启动) | 正在制作中 ... </a></li> <li><a href="http://weharmonyos.com/blog/95.html" target="_blank" rel="noopener noreferrer">v95.06 鸿蒙内核源码分析(系统调用) | 开发者永远的口头禅</a></li> <li><a href="http://weharmonyos.com/blog/96.html" target="_blank" rel="noopener noreferrer">v96.01 鸿蒙内核源码分析(VDSO) | 正在制作中 ... </a></li></ul> <p><strong>调测工具</strong></p> <ul><li><a href="http://weharmonyos.com/blog/97.html" target="_blank" rel="noopener noreferrer">v97.01 鸿蒙内核源码分析(模块监控) | 正在制作中 ... </a></li> <li><a href="http://weharmonyos.com/blog/98.html" target="_blank" rel="noopener noreferrer">v98.01 鸿蒙内核源码分析(日志跟踪) | 正在制作中 ... </a></li> <li><a href="http://weharmonyos.com/blog/99.html" target="_blank" rel="noopener noreferrer">v99.01 鸿蒙内核源码分析(系统安全) | 正在制作中 ... </a></li> <li><a href="http://weharmonyos.com/blog/100.html" target="_blank" rel="noopener noreferrer">v100.01 鸿蒙内核源码分析(测试用例) | 正在制作中 ... </a></li></ul> <p><strong>前因后果</strong></p> <ul><li><a href="http://weharmonyos.com/blog/101.html" target="_blank" rel="noopener noreferrer">v101.03 鸿蒙内核源码分析(总目录) | 精雕细琢 锤炼精品</a></li> <li><a href="http://weharmonyos.com/blog/102.html" target="_blank" rel="noopener noreferrer">v102.05 鸿蒙内核源码分析(源码注释) | 每天死磕一点点</a></li> <li><a href="http://weharmonyos.com/blog/103.html" target="_blank" rel="noopener noreferrer">v103.05 鸿蒙内核源码分析(静态站点) | 码农都不爱写注释和文档</a></li> <li><a href="http://weharmonyos.com/blog/104.html" target="_blank" rel="noopener noreferrer">v104.01 鸿蒙内核源码分析(参考手册) | 阅读内核源码必备工具</a></li></ul> <h4 id="三-百万注内核-处处扣细节-细胞血管">三： 百万注内核 | 处处扣细节 | 细胞血管</h4> <ul><li><p>百万汉字注解内核目的是要看清楚其毛细血管，细胞结构，等于在拿放大镜看内核。内核并不神秘，带着问题去源码中找答案是很容易上瘾的，你会发现很多文章对一些问题的解读是错误的，或者说不深刻难以自圆其说，你会慢慢形成自己新的解读，而新的解读又会碰到新的问题，如此层层递进，滚滚向前，拿着放大镜根本不愿意放手。</p></li> <li><p>因鸿蒙内核6W+代码量，本身只有较少的注释， 中文注解以不对原有代码侵入为前提，源码中所有英文部分都是原有注释，所有中文部分都是中文版的注释，同时为方便同步官方版本的更新，尽量不去增加代码的行数，不破坏文件的结构，注释多类似以下的方式:</p> <ul><li><p>在重要模块的<code>.c/.h</code>文件开始位置先对模块功能做整体的介绍，例如异常接管模块注解如图所示:</p> <p><img src="https://weharmonyos.oss-cn-hangzhou.aliyuncs.com/resources/13/ycjg.png" alt="">
注解过程中查阅了很多的资料和书籍，在具体代码处都附上了参考链接。</p></li> <li><p>绘制字符图帮助理解模块 ，例如 虚拟内存区域分布没有图很难理解。
<img src="https://weharmonyos.oss-cn-hangzhou.aliyuncs.com/resources/13/vm.png" alt=""></p></li> <li><p>而函数级注解会详细到重点行，甚至每一行， 例如申请互斥锁的主体函数，不可谓不重要，而官方注释仅有一行，如图所示</p> <p><img src="https://weharmonyos.oss-cn-hangzhou.aliyuncs.com/resources/13/sop.png" alt=""></p></li></ul></li> <li><p>注解创建了一些特殊记号，可直接搜索查看</p> <ul class="task-list-container"><li class="task-list-item"><input type="checkbox" checked="checked" disabled="disabled" id="task-item-0" class="task-list-item-checkbox"> 搜索 <code>@note_pic</code><label for="task-item-0" class="task-list-item-label"> 搜索 `@note_pic` 可查看绘制的全部字符图</label></li> <li class="task-list-item"><input type="checkbox" checked="checked" disabled="disabled" id="task-item-1" class="task-list-item-checkbox"> 搜索 <code>@note_why</code> 是尚未看明白的地方，有看明白的，请<a href="https://gitee.com/weharmony/kernel_liteos_a_note/pull/new/weharmony:master...weharmony:master" target="_blank" rel="noopener noreferrer">新建 Pull Request</a><label for="task-item-1" class="task-list-item-label"> 搜索 `@note_why` 是尚未看明白的地方，有看明白的，请[新建 Pull Request](https://gitee.com/weharmony/kernel_liteos_a_note/pull/new/weharmony:master...weharmony:master)完善</label></li> <li class="task-list-item"><input type="checkbox" checked="checked" disabled="disabled" id="task-item-2" class="task-list-item-checkbox"> 搜索 <code>@note_thinking</code><label for="task-item-2" class="task-list-item-label"> 搜索 `@note_thinking` 是一些的思考和建议</label></li> <li class="task-list-item"><input type="checkbox" checked="checked" disabled="disabled" id="task-item-3" class="task-list-item-checkbox"> 搜索 <code>@note_#if0</code><label for="task-item-3" class="task-list-item-label"> 搜索 `@note_#if0` 是由第三方项目提供不在内核源码中定义的极为重要结构体，为方便理解而添加的。</label></li> <li class="task-list-item"><input type="checkbox" checked="checked" disabled="disabled" id="task-item-4" class="task-list-item-checkbox"> 搜索 <code>@note_link</code><label for="task-item-4" class="task-list-item-label"> 搜索 `@note_link` 是网址链接，方便理解模块信息，来源于官方文档，百篇博客，外部链接</label></li> <li class="task-list-item"><input type="checkbox" checked="checked" disabled="disabled" id="task-item-5" class="task-list-item-checkbox"> 搜索 <code>@note_good</code><label for="task-item-5" class="task-list-item-label"> 搜索 `@note_good` 是给源码点赞的地方</label></li></ul></li></ul> <h4 id="四-参考手册-doxygen呈现-诊断">四： 参考手册 | Doxygen呈现 | 诊断</h4> <p>在中文加注版基础上构建了参考手册，如此可以看到毛细血管级的网络图，注解支持 <a href="https://www.doxygen.nl" target="_blank" rel="noopener noreferrer">doxygen</a> 格式标准。</p> <ul><li><p>图为内核<code>main</code>的调用关系直观展现，如果没有这张图，光<code>main</code>一个函数就够喝一壶。 <code>main</code>本身是由汇编指令 <code>bl main</code>调用
<img src="https://weharmonyos.oss-cn-hangzhou.aliyuncs.com/resources/73/1.png" alt="">
可前往 &gt;&gt; <a href="http://doxygen.weharmonyos.com/index.html" target="_blank" rel="noopener noreferrer">鸿蒙研究站 | 参考手册 </a> 体验</p></li> <li><p>图为内核所有结构体索引，点击可查看每个结构变量细节
<img src="https://weharmonyos.oss-cn-hangzhou.aliyuncs.com/resources/73/6.png" alt="">
可前往 &gt;&gt; <a href="http://doxygen.weharmonyos.com/classes.html" target="_blank" rel="noopener noreferrer">鸿蒙研究站 | 结构体索引 </a> 体验</p></li></ul> <h3 id="鸿蒙论坛-干净-营养-不盲从">鸿蒙论坛 | 干净.营养.不盲从</h3> <ul><li>搭个论坛貌似不合时宜, 但站长却固执的认为它是技术人最好的沟通方式, 它不像群各种叨絮使人焦虑被逼的屏蔽它, 它更像个异性知己,懂你给你留足空间思考,从不扰乱你的生活,鸿蒙论坛会一直存在,并坚持自己的风格(干净.营养.不盲从)。选择 Discuz 是因为它太优秀, 一个沉淀了20年的开源平台,被所谓的时代遗忘实在是太过可惜。哪天您得空了就去逛逛吧 , 它可能并没有那么糟糕。</li> <li><a href="http://8.134.122.205/" target="_blank" rel="noopener noreferrer"><img src="https://weharmonyos.oss-cn-hangzhou.aliyuncs.com/resources/bbs/bbs.png" alt=""></a></li></ul> <h3 id="四大码仓发布-源码同步官方">四大码仓发布 | 源码同步官方</h3> <p>内核注解同时在 <a href="https://gitee.com/weharmony/kernel_liteos_a_note" target="_blank" rel="noopener noreferrer">gitee</a> | <a href="https://github.com/kuangyufei/kernel_liteos_a_note" target="_blank" rel="noopener noreferrer">github</a> | <a href="https://weharmony.coding.net/public/harmony/kernel_liteos_a_note/git/files" target="_blank" rel="noopener noreferrer">coding</a> | <a href="https://gitcode.net/kuangyufei/kernel_liteos_a_note" target="_blank" rel="noopener noreferrer">gitcode</a> 发布，并与官方源码按月保持同步，同步历史如下:</p> <ul><li><code>2022/08/28</code> -- 完善测试用例</li> <li><code>2022/07/18</code> -- 开机代码微调</li> <li><code>2022/06/03</code> -- 增加 jffs2 编译选项</li> <li><code>2022/05/09</code> -- 标准库(musl , newlib) 目录调整</li> <li><code>2022/04/16</code> -- 任务调度模块有很大更新</li> <li><code>2022/03/23</code> -- 新增各CPU核自主管理中断, 定时器模块较大调整</li> <li><code>2022/02/18</code> -- 官方无代码更新, 只有测试用例的完善</li> <li><code>2022/01/20</code> -- 同步官方代码,本次官方对测试用例和MMU做了较大调整</li> <li><code>2021/12/20</code> -- 增加<code>LMS</code>模块，完善<code>PM，Fat Cache</code></li> <li><code>2021/11/12</code> -- 加入<code>epoll</code>支持，对<code>shell</code>模块有较大调整，微调<code>process</code>，<code>task</code>，更正单词拼写错误</li> <li><code>2021/10/21</code> -- 增加性能优化模块<code>perf</code>，优化了文件映射模块</li> <li><code>2021/09/14</code> -- <code>common</code>，<code>extended</code>等几个目录结构和Makefile调整</li> <li><code>2021/08/19</code> -- 各目录增加了<code>BUILD。gn</code>文件，文件系统部分文件调整</li> <li><code>2021/07/15</code> -- 改动不大，新增<code>blackbox</code>，<code>hidumper</code>，对一些宏规范化使用</li> <li><code>2021/06/27</code> -- 对文件系统/设备驱动改动较大，目录结构进行了重新整理</li> <li><code>2021/06/08</code> -- 对编译构建，任务，信号模块有较大的改动</li> <li><code>2021/05/28</code> -- 改动不大，主要针对一些错误单词拼写纠正</li> <li><code>2021/05/13</code> -- 对系统调用，任务切换，信号处理，异常接管，文件管理，<code>shell</code>做了较大更新，代码结构更清晰</li> <li><code>2021/04/21</code> -- 官方优化了很多之前吐槽的地方，点赞</li> <li><code>2020/09/16</code> -- 中文注解版起点</li></ul> <h3 id="注解子系统仓库">注解子系统仓库</h3> <p>在给鸿蒙内核源码加注过程中发现仅仅注解内核仓库还不够，因为它关联了其他子系统，若对这些子系统不了解是很难完整的注解鸿蒙内核，所以也对这些关联仓库进行了部分注解，这些仓库包括:</p> <ul><li><a href="https://gitee.com/weharmony/build_lite_note" target="_blank" rel="noopener noreferrer">编译构建子系统 | build_lite</a></li> <li><a href="https://gitee.com/weharmony/third_party_lwip" target="_blank" rel="noopener noreferrer">协议栈 | lwip</a></li> <li><a href="https://gitee.com/weharmony/third_party_NuttX" target="_blank" rel="noopener noreferrer">文件系统 | NuttX</a></li> <li><a href="https://gitee.com/weharmony/third_party_musl" target="_blank" rel="noopener noreferrer">标准库 | musl</a></li></ul> <h3 id="关于-zzz-目录">关于 zzz 目录</h3> <p>中文加注版比官方版无新增文件，只多了一个<code>zzz</code>的目录，里面放了一些加注所需文件，它与内核代码无关，可以忽略它，取名<code>zzz</code>是为了排在最后，减少对原有代码目录级的侵入，<code>zzz</code> 的想法源于微信中名称为<code>AAA</code>的那帮朋友，你的微信里应该也有他们熟悉的身影吧 😃</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>/kernel/liteos_a
├── apps                   # 用户态的init和shell应用程序
├── arch                   # 体系架构的目录，如arm等
│   └── arm                # arm架构代码
├── bsd                    # freebsd相关的驱动和适配层模块代码引入，例如USB等
├── compat                 # 内核接口兼容性目录
│   └── posix              # posix相关接口
├── drivers                # 内核驱动
│   └── char               # 字符设备
│       ├── mem            # 访问物理IO设备驱动
│       ├── quickstart     # 系统快速启动接口目录
│       ├── random         # 随机数设备驱动
│       └── video          # framebuffer驱动框架
├── fs                     # 文件系统模块，主要来源于NuttX开源项目
│   ├── fat                # fat文件系统
│   ├── jffs2              # jffs2文件系统
│   ├── include            # 对外暴露头文件存放目录
│   ├── nfs                # nfs文件系统
│   ├── proc               # proc文件系统
│   ├── ramfs              # ramfs文件系统
│   └── vfs                # vfs层
├── kernel                 # 进程、内存、IPC等模块
│   ├── base               # 基础内核，包括调度、内存等模块
│   ├── common             # 内核通用组件
│   ├── extended           # 扩展内核，包括动态加载、vdso、liteipc等模块
│   ├── include            # 对外暴露头文件存放目录
│   └── user               # 加载init进程
├── lib                    # 内核的lib库
├── net                    # 网络模块，主要来源于lwip开源项目
├── platform               # 支持不同的芯片平台代码，如Hi3516DV300等
│   ├── hw                 # 时钟与中断相关逻辑代码
│   ├── include            # 对外暴露头文件存放目录
│   └── uart               # 串口相关逻辑代码
├── security               # 安全特性相关的代码，包括进程权限管理和虚拟id映射管理
├── syscall                # 系统调用 
├── testsuites             # 单元测试用例 
├── tools                  # 构建工具及相关配置和代码
└── zzz                    # 中文注解版新增目录
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br></div></div><h3 id="官方文档-静态站点呈现">官方文档 | 静态站点呈现</h3> <ul><li><p>研究鸿蒙需不断的翻阅资料，吸取精华，其中官方文档必不可少， 为更好的呈现 <strong>OpenHarmony开发文档</strong> ， 特意做了静态站点 <a href="https://weharmony.github.io" target="_blank" rel="noopener noreferrer"> &gt;&gt; 鸿蒙研究站 | 官方文档</a> 来方便查阅官方资料，与官方资料保持同步更新。</p></li> <li><p>左侧导航栏，右边索引区
<img src="https://weharmonyos.oss-cn-hangzhou.aliyuncs.com/resources/52/4.png" alt=""></p></li></ul></div> <!----> <div class="content__content-bottom"></div> <footer class="page-meta"><!----> <!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev"><a href="/blog/101.html" class="prev"><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" class="icon prev-icon"><path d="M906.783 588.79c-.02 8.499-6.882 15.36-15.38 15.37l-443.7-.01 75.704 191.682c2.52 6.42.482 13.763-5.038 17.91-5.52 4.168-13.138 4.147-18.616-.092L123.228 524.175a15.362 15.362 0 0 1-6-12.165c0-4.782 2.222-9.277 6-12.185L499.753 210.35a15.388 15.388 0 0 1 9.38-3.195c3.236 0 6.502 1.034 9.236 3.103 5.52 4.147 7.578 11.49 5.038 17.91L447.683 419.84l443.72-.01c8.498.01 15.36 6.881 15.36 15.36l.02 153.6z" fill="currentColor"></path></svg>
        总目录
      </a></span> <span class="next"><a href="/blog/103.html">
        静态站点
        <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" class="icon next-icon"><path d="M906.772 512c0 4.772-2.211 9.267-5.99 12.175L524.257 813.66a15.37 15.37 0 0 1-18.616.092 15.368 15.368 0 0 1-5.038-17.91l75.714-191.672h-443.73c-8.488 0-15.36-6.881-15.36-15.36v-153.6c0-8.489 6.872-15.36 15.36-15.36h443.73l-75.714-191.682a15.358 15.358 0 0 1 5.048-17.91c5.51-4.158 13.128-4.137 18.606.092l376.525 289.485a15.323 15.323 0 0 1 5.99 12.165z" fill="currentColor"></path></svg></a></span></p></div> <!----> <!----> <div class="content__page-bottom"></div></main> <!----></div><div class="global-ui"><!----><!----><div id="pwa-install"><!----> <div id="install-modal-wrapper" style="display:none;"><div class="background"></div> <div class="install-modal"><div class="header"><button aria-label="Close" class="close-button"><svg width="23" height="22" xmlns="http://www.w3.org/2000/svg" class="icon close-icon"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.12.358a1.224 1.224 0 011.729 0l8.92 8.914L20.686.358a1.224 1.224 0 011.73 1.728L13.497 11l8.92 8.913a1.222 1.222 0 11-1.73 1.729l-8.919-8.913-8.92 8.913a1.224 1.224 0 01-1.729-1.729L10.04 11l-8.92-8.914a1.222 1.222 0 010-1.728z" fill="currentColor"></path></svg></button> <div class="logo"><!----> <div class="title"><h1></h1> <p class="desc">This app can be installed on your PC or mobile device.  This will allow this web app to look and behave like any other installed app.  You will find it in your app lists and be able to pin it to your home screen, start menus or task bars.  This installed web app will also be able to safely interact with other apps and your operating system. </p></div></div></div> <div class="content"><div class="highlight"><!----> <!----></div> <div class="description"><h3>Description</h3> <p></p></div></div> <div class="button-wrapper"><button class="install-button">
        Install <span></span></button> <button class="cancel-button">
        Cancel
      </button></div></div></div></div><div tabindex="-1" role="dialog" aria-hidden="true" class="pswp"><div class="pswp__bg"></div> <div class="pswp__scroll-wrap"><div class="pswp__container"><div class="pswp__item"></div> <div class="pswp__item"></div> <div class="pswp__item"></div></div> <div class="pswp__ui pswp__ui--hidden"><div class="pswp__top-bar"><div class="pswp__counter"></div> <button title="Close" aria-label="Close" class="pswp__button pswp__button--close"></button> <button title="Share" aria-label="Share" class="pswp__button pswp__button--share"></button> <button title="Switch to full screen" aria-label="Switch to full screen" class="pswp__button pswp__button--fs"></button> <button title="Zoom in/out" aria-label="Zoom in/out" class="pswp__button pswp__button--zoom"></button> <div class="pswp__preloader"><div class="pswp__preloader__icn"><div class="pswp__preloader__cut"><div class="pswp__preloader__donut"></div></div></div></div></div> <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap"><div class="pswp__share-tooltip"></div></div> <button title="Prev (Arrow Left)" aria-label="Prev (Arrow Left)" class="pswp__button pswp__button--arrow--left"></button> <button title="Next (Arrow Right)" aria-label="Next (Arrow Right)" class="pswp__button pswp__button--arrow--right"></button> <div class="pswp__caption"><div class="pswp__caption__center"></div></div></div></div></div></div></div>
    <script src="/assets/js/app.9a8b95d8.js" defer></script><script src="/assets/js/vendors~layout-Layout.c1e797d4.js" defer></script><script src="/assets/js/vendors~layout-Blog~layout-Layout~layout-NotFound.f75cf258.js" defer></script><script src="/assets/js/page--7180d470.73a3a20e.js" defer></script>
  </body>
</html>
